from flask import Flask,render_template,Response
from flask_restful import Api,Resource
import json

app = Flask(__name__)
# 如果想要前端的中文不再是\u这样的编码，可以加如下参数配置
app.config['RESTFUL_JSON'] = dict(ensure_ascii=False)
api = Api(app)

class IndexView(Resource):
    def get(self):
        return render_template('index.html')

api.add_resource(IndexView,'/index/')

@api.representation('text/html')
def out_html(data,code,headers):
    resp = Response(data)
    return resp

if __name__ == '__main__':
  app.run(debug=True)
